home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLINC.PAK / TIMEGADG.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  73 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1995, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.5  $
  6. //
  7. // Definition of class TTimeGadget
  8. //----------------------------------------------------------------------------
  9. #if !defined(OWL_TIMEGADG_H)
  10. #define OWL_TIMEGADG_H
  11.  
  12. #if !defined(OWL_TEXTGADG_H)
  13. # include <owl/textgadg.h>
  14. #endif
  15. #if !defined(CLASSLIB_TIME_H)
  16. # include <classlib/time.h>
  17. #endif
  18.  
  19. #if defined(BI_NAMESPACE)
  20. namespace OWL {
  21. #endif
  22.  
  23. // Generic definitions/compiler options (eg. alignment) preceeding the
  24. // definition of classes
  25. #include <services/preclass.h>
  26.  
  27. //
  28. // class TTimeGadget
  29. // ~~~~~ ~~~~~~~~~~~
  30. // A gadget for displaying a time and/or date message.
  31. //
  32. class _OWLCLASS TTimeGadget : public TTextGadget {
  33.   public:
  34.  
  35.     typedef void _CALLCNVN (*TGetTimeFunc)(string&);
  36.  
  37. #if defined(BI_PLAT_WIN32)
  38.     TTimeGadget(TGetTimeFunc timeFunc = &TTimeGadget::GetSystemTime,
  39. #else
  40.     TTimeGadget(TGetTimeFunc timeFunc = &TTimeGadget::GetTTime,
  41. #endif
  42.                 int id = 0,
  43.                 TBorderStyle = Recessed,
  44.                 TAlign = Center,
  45.                 uint numChars = 12,
  46.                 const char* text = 0,
  47.                 TFont* font = 0 /*new TGadgetWindowFont*/);
  48.  
  49.     // Override from TGadget
  50.     //
  51.     void  Created();
  52.     bool  IdleAction(long count);
  53.  
  54.     static void GetTTime(string&);
  55. #if defined(BI_PLAT_WIN32)
  56.     static void GetSystemTime(string&);
  57.     static void GetLocalTime(string&);
  58. #endif
  59.  
  60.   private:
  61.     TGetTimeFunc TimeFunc;
  62. };
  63.  
  64. // Generic definitions/compiler options (eg. alignment) following the
  65. // definition of classes
  66. #include <services/posclass.h>
  67.  
  68. #if defined(BI_NAMESPACE)
  69. } // namespace OWL
  70. #endif
  71.  
  72. #endif  // OWL_TIMEGADG_H
  73.